<template>
	<view>
		<u-form :model="form" ref="uForm">
			<u-form-item label="手机号" prop="phone">
				<u-input v-model="form.phone" />
			</u-form-item>
			<u-form-item label="密码" prop="password">
				<u-input v-model="form.password" />
			</u-form-item>
			
			<!-- <u-row customStyle="margin-bottom: 10px">
			    <u-col span="8">
			        <view class="demo-layout bg-purple-light">
						<u-form-item label="验证码" prop="code">
							<u-input v-model="form.code" />
						</u-form-item>
						</view>
			    </u-col>
			    <u-col span="4">
			        <view class="demo-layout bg-purple">
						<u-button type="success" @click="register1">发送验证码验证</u-button>
					</view>
			    </u-col>
			</u-row> -->
			<u-button type="primary" @click="register2">注册</u-button>
		</u-form>
		
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					phone: '',
					password:'',
					// code:'',
					
				
					
				},
				
			};
		},
		methods:{
			register2(){
			this.$api({
				method: 'post',
				url: '/system/login/register',
				 data: this.form
			}).then(res => {
				// uni.setStorageSync('token', res.data);
				// console.log("----------------index"+token.id);
				if (res.data != null) {
					
					uni.reLaunch({
						url:"/pages/index/index",
						
					})
				} else {
						// console.log(res.data);
					// this.showToast(this.list1),
					console.log("失败");
				}
				
			}).catch(err => {
				console.log(err)
			});
			}
		}
		
	}
</script>

<style lang="scss">

</style>
